package com.drug.wms.error;

public class BusinessException extends RuntimeException implements CommonError{

    private CommonError commonError;

    public BusinessException(CommonError commonError) {
        super(commonError.getMsg());
        this.commonError = commonError;
    }

    public BusinessException(CommonError commonError,String msg) {
        super(msg);
        this.commonError = commonError.setMsg(msg);
    }

    @Override
    public String getCode() {
        return commonError.getCode();
    }

    @Override
    public String getMsg() {
        return commonError.getMsg();
    }

    @Override
    public CommonError setMsg(String msg) {
        return this.commonError.setMsg(msg);
    }
}
